****************************************************** New Model 5/26/06* RUN COMPARE_EP_STOIBER DO FILE FIRST BEFORE RUNNING THIS FILE* COMPARE_EP_STOIBER PREPARES THE DATA. IF YOU RUN THIS FILE WITHOUT RUNNING* COMPARE_EP_STOIBER FIRST, DATA COULD BE WRONG ** This code loads data which was created in Fix_IGC do file* It runs main models from dissertation chapter 2****************************************************clear version 8.2* change dircd "/Users/jslapin/Documents/papers and diss/IO Replication Materials"*load datause "temp/ams_jbs_temp.dta", clear************************************************************************ First transform data so sq always equals 0* Now preferences do not reflect an integrationalist positionreplace com= abs(com-sq) if sq~=0     replace ep= abs(ep-sq) if sq~=0replace b= abs(b-sq) if sq~=0replace dk= abs(dk-sq) if sq~=0replace d= abs(d-sq) if sq~=0replace gr= abs(gr-sq) if sq~=0replace e= abs(e-sq) if sq~=0replace f= abs(f-sq) if sq~=0replace irl= abs(irl-sq) if sq~=0replace i= abs(i-sq) if sq~=0replace lux= abs(lux-sq) if sq~=0replace nl= abs(nl-sq) if sq~=0replace a= abs(a-sq) if sq~=0replace p= abs(p-sq) if sq~=0replace sf= abs(sf-sq) if sq~=0replace s= abs(s-sq) if sq~=0replace uk= abs(uk-sq) if sq~=0replace am= abs(am-sq) if sq~=0replace sq=0 if sq~=0************************************************************************* In earlier models, I tested whether it mattered if I drop issues ** where a compromise position was reached. ** In final model I keep everything.* drop if am~=0&am~=1************************************************************************ Here I count number missing by member state* I create a dummy variable to indicate whether each member state is * missing on an issue. I then sum the dummy variables.gen missdumb=1 if b==.replace missdumb=0 if missdumb==.gen missdumdk=1 if dk==.replace missdumdk=0 if missdumdk==.gen missdumd=1 if d==.replace missdumd=0 if missdumd==.gen missdumgr=1 if gr==.replace missdumgr=0 if missdumgr==.gen missdume=1 if e==.replace missdume=0 if missdume==.gen missdumf=1 if f==.replace missdumf=0 if missdumf==.gen missdumirl=1 if irl==.replace missdumirl=0 if missdumirl==.gen missdumi=1 if i==.replace missdumi=0 if missdumi==.gen missdumlux=1 if lux==.replace missdumlux=0 if missdumlux==.gen missdumnl=1 if nl==.replace missdumnl=0 if missdumnl==.gen missduma=1 if a==.replace missduma=0 if missduma==.gen missdump=1 if p==.replace missdump=0 if missdump==.gen missdumsf=1 if sf==.replace missdumsf=0 if missdumsf==.gen missdums=1 if s==.replace missdums=0 if missdums==.gen missdumuk=1 if uk==.replace missdumuk=0 if missdumuk==.gen nummiss=missdumb+missdumdk+missdumd+missdumgr /**/+missdume+missdumf+missdumirl+missdumi+missdumlux+/**/missdumnl+missduma+missdump+missdumsf+missdums+missdumuk*********************************************************************************** Now I count the number of member states on the status quo* This counts only true status quo positions, not missing positionsgen sqdumb=1 if b==sqreplace sqdumb=0 if sqdumb==.gen sqdumdk=1 if dk==sqreplace sqdumdk=0 if sqdumdk==.gen sqdumd=1 if d==sqreplace sqdumd=0 if sqdumd==.gen sqdumgr=1 if gr==sqreplace sqdumgr=0 if sqdumgr==.gen sqdume=1 if e==sqreplace sqdume=0 if sqdume==.gen sqdumf=1 if f==sqreplace sqdumf=0 if sqdumf==.gen sqdumirl=1 if irl==sqreplace sqdumirl=0 if sqdumirl==.gen sqdumi=1 if i==sqreplace sqdumi=0 if sqdumi==.gen sqdumlux=1 if lux==sqreplace sqdumlux=0 if sqdumlux==.gen sqdumnl=1 if nl==sqreplace sqdumnl=0 if sqdumnl==.gen sqduma=1 if a==sqreplace sqduma=0 if sqduma==.gen sqdump=1 if p==sqreplace sqdump=0 if sqdump==.gen sqdumsf=1 if sf==sqreplace sqdumsf=0 if sqdumsf==.gen sqdums=1 if s==sqreplace sqdums=0 if sqdums==.gen sqdumuk=1 if uk==sqreplace sqdumuk=0 if sqdumuk==.gen numsq=sqdumb+sqdumdk+sqdumd+sqdumgr+sqdume+sqdumf+sqdumirl+ /**/ sqdumi+sqdumlux+sqdumnl+sqduma+sqdump+sqdumsf+sqdums+sqdumuk*************************************************************************************** Here I choose my general assumption about missing preferences* turning this section off assumes list wise deletionreplace com= sq if com==.replace ep= sq if ep==.replace b= sq if b==.replace dk= sq if dk==.replace d= sq if d==.replace gr= sq if gr==.replace e= sq if e==.replace f= sq if f==.replace irl= sq if irl==.replace i= sq if i==.replace lux= sq if lux==.replace nl= sq if nl==.replace a= sq if a==.replace p= sq if p==.replace sf= sq if sf==.replace s= sq if s==.replace uk= sq if uk==.*************************************************************************** Here I calculate BDM variable* I assume missing positions signifies low salience, i.e. lower intensity preference * for the status quo* rescale BDM var so sq==-1, issue inclusion ==1 and indifference==0 * Include salience dummy ==1 if issue is present and zero otherwise.*************************************************************************** rescale all prefs from -1 to 1replace sq= -1 replace b= 2*b-1replace dk= 2*dk-1replace d= 2*d-1replace gr= 2*gr-1replace e= 2*e-1replace f= 2*f-1replace irl= 2*irl-1replace i= 2*i-1replace lux= 2*lux-1replace nl= 2*nl-1replace a= 2*a-1replace p= 2*p-1replace sf= 2*sf-1replace s= 2*s-1replace uk= 2*uk-1* calculate BDM variable using gdp as a measure of capabilities* recode missdum vars so missing is 0 and present is 1* 1997 GDP taken from Eurostat 3/14/06. Denominated in thousands of Euros* calculated as member state gdp over total EU 15 GDPrecode missdumb missdumdk missdumd missdumgr /**/ missdume missdumf missdumirl missdumi missdumlux /**/missdumnl missduma missdump missdumsf missdums missdumuk /**/ (0=1)(1=0)gen gdpb=220129.4gen gdpdk=150414.1gen gdpd=1907246.2gen gdpgr=107103.0gen gdpe=505391.7gen gdpf=1258310.6gen gdpirl=71717.6gen gdpi=1052553.8gen gdplux=15417.1gen gdpnl=332653.9gen gdpa=184287.1gen gdpp=98831.3gen gdpsf=109075gen gdps=220161.8gen gdpuk=1170875.1gen gdptot=gdpb+gdpdk+gdpd+gdpgr+gdpe+gdpf+gdpirl+gdpi+gdplux+gdpnl+gdpa+gdpp+gdpsf+gdps+gdpuk gen vsb=gdpb/gdptot gen vsdk=gdpdk/gdptot gen vsd=gdpd/gdptot gen vsgr=gdpgr/gdptot gen vse=gdpe/gdptot gen vsf=gdpf/gdptot gen vsirl=gdpirl/gdptot gen vsi=gdpi/gdptot gen vslux=gdplux/gdptot gen vsnl=gdpnl/gdptot gen vsa=gdpa/gdptot gen vsp=gdpp/gdptot gen vssf=gdpsf/gdptot gen vss=gdps/gdptot gen vsuk=gdpuk/gdptotgen utilitydraftb=missdumb*vsb*(-(b-1)^2-(-(b-sq)^2))gen utilitydraftdk=missdumdk*vsdk*(-((dk-1)^2)-(-(dk-sq)^2))gen utilitydraftd=missdumd*vsd*(-(d-1)^2-(-(d-sq)^2))gen utilitydraftgr=missdumgr*vsgr*(-(gr-1)^2-(-(gr-sq)^2))gen utilitydrafte=missdume*vse*(-(e-1)^2-(-(e-sq)^2))gen utilitydraftf=missdumf*vsf*(-(f-1)^2-(-(f-sq)^2))gen utilitydraftirl=missdumirl*vsirl*(-(irl-1)^2-(-(irl-sq)^2))gen utilitydrafti=missdumi*vsi*(-(i-1)^2-(-(i-sq)^2))gen utilitydraftlux=missdumlux*vslux*(-(lux-1)^2-(-(lux-sq)^2))gen utilitydraftnl=missdumnl*vsnl*(-(nl-1)^2-(-(nl-sq)^2))gen utilitydrafta=missduma*vsa*(-(a-1)^2-(-(a-sq)^2))gen utilitydraftp=missdump*vsp*(-(p-1)^2-(-(p-sq)^2))gen utilitydraftsf=missdumsf*vssf*(-(sf-1)^2-(-(sf-sq)^2))gen utilitydrafts=missdums*vss*(-(s-1)^2-(-(s-sq)^2))gen utilitydraftuk=missdumuk*vsuk*(-(uk-1)^2-(-(uk-sq)^2))gen BDMpred= utilitydraftb+utilitydraftdk+utilitydraftd+ /**/utilitydraftgr+utilitydrafte+utilitydraftf+utilitydraftirl+/**/utilitydrafti+utilitydraftlux+utilitydraftnl+utilitydrafta+/**/ utilitydraftp+utilitydraftsf+utilitydrafts+utilitydraftuk* recalculate BDMpred without the saliency term. This would be the same as assuming that missing * prefs are exactly like preferences for the status quo.gen utilitydraftb1=vsb*(-(b-1)^2-(-(b-sq)^2))gen utilitydraftdk1=vsdk*(-((dk-1)^2)-(-(dk-sq)^2))gen utilitydraftd1=vsd*(-(d-1)^2-(-(d-sq)^2))gen utilitydraftgr1=vsgr*(-(gr-1)^2-(-(gr-sq)^2))gen utilitydrafte1=vse*(-(e-1)^2-(-(e-sq)^2))gen utilitydraftf1=vsf*(-(f-1)^2-(-(f-sq)^2))gen utilitydraftirl1=vsirl*(-(irl-1)^2-(-(irl-sq)^2))gen utilitydrafti1=vsi*(-(i-1)^2-(-(i-sq)^2))gen utilitydraftlux1=vslux*(-(lux-1)^2-(-(lux-sq)^2))gen utilitydraftnl1=vsnl*(-(nl-1)^2-(-(nl-sq)^2))gen utilitydrafta1=vsa*(-(a-1)^2-(-(a-sq)^2))gen utilitydraftp1=vsp*(-(p-1)^2-(-(p-sq)^2))gen utilitydraftsf1=vssf*(-(sf-1)^2-(-(sf-sq)^2))gen utilitydrafts1=vss*(-(s-1)^2-(-(s-sq)^2))gen utilitydraftuk1=vsuk*(-(uk-1)^2-(-(uk-sq)^2))gen BDMpred1= utilitydraftb1+utilitydraftdk1+utilitydraftd1+ /**/utilitydraftgr1+utilitydrafte1+utilitydraftf1+utilitydraftirl1+/**/utilitydrafti1+utilitydraftlux1+utilitydraftnl1+utilitydrafta1+/**/ utilitydraftp1+utilitydraftsf1+utilitydrafts1+utilitydraftuk1****************************************************************************** Calculate number missing weighted by gdpgen gdpweightmiss=missdumb*vsb+missdumdk*vsdk+missdumd*vsd+missdumgr*vsgr+missdume*vse+missdumf*vsf+/**/missdumirl*vsirl+missdumi*vsi+missdumlux*vslux+missdumnl*vsnl+missduma*vsa+missdump*vsp+/**/missdumsf*vssf+missdums*vss+missdumuk*vsuk* Calculate George's suggestion (10/3/06)- number on sq weighted by gdpgen gdpweightsq=sqdumb*vsb+sqdumdk*vsdk+sqdumd*vsd+sqdumgr*vsgr+sqdume*vse+sqdumf*vsf+/**/sqdumirl*vsirl+sqdumi*vsi+sqdumlux*vslux+sqdumnl*vsnl+sqduma*vsa+sqdump*vsp+/**/sqdumsf*vssf+sqdums*vss+sqdumuk*vsuk* Calculate Number on sq weighted by council votesgen cweightsq=sqdumb*5+sqdumdk*3+sqdumd*10+sqdumgr*5+sqdume*8+sqdumf*10+/**/sqdumirl*3+sqdumi*10+sqdumlux*2+sqdumnl*5+sqduma*4+sqdump*5+/**/sqdumsf*3+sqdums*4+sqdumuk*10* Calculate Number missing weighted by council votesgen cweightmiss=missdumb*5+missdumdk*3+missdumd*10+missdumgr*5+missdume*8+missdumf*10+/**/missdumirl*3+missdumi*10+missdumlux*2+missdumnl*5+missduma*4+missdump*5+/**/missdumsf*3+missdums*4+missdumuk*10* Calculate Number sq weighted by % populationgen popb= 10170226gen popdk= 5275121gen popd= 82012162 gen popgr=10744649gen pope=39525438 gen popf=58116018 gen popirl=3654955gen popi=56879278 gen poplux=416850gen popnl=15567107 gen popa=7964966gen popp=10072542 gen popsf=5132320 gen pops=8844499 gen popuk=58905050 gen totpop=popb+popdk+popd+popgr+pope+popf+popirl+popi+poplux+popnl+popa+popp+popsf+pops+popukgen popmiss=(missdumb*popb/totpop)+(missdumdk*popdk/totpop)+(missdumd*popd/totpop)+(missdumgr*popgr/totpop)+/**/(missdume*pope/totpop)+(missdumf*popf/totpop)+(missdumirl*popirl/totpop)+(missdumi*popi/totpop)+/**/ (missdumlux*poplux/totpop)+(missdumnl*popnl/totpop)+(missduma*popa/totpop)+(missdump*popp/totpop)/**/+(missdumsf*popsf/totpop)+(missdums*pops/totpop)+(missdumuk*popuk/totpop)gen popsq=(sqdumb*popb/totpop)+(sqdumdk*popdk/totpop)+(sqdumd*popd/totpop)+(sqdumgr*popgr/totpop)+/**/(sqdume*pope/totpop)+(sqdumf*popf/totpop)+(sqdumirl*popirl/totpop)+(sqdumi*popi/totpop)+/**/ (sqdumlux*poplux/totpop)+(sqdumnl*popnl/totpop)+(sqduma*popa/totpop)+(sqdump*popp/totpop)/**/+(sqdumsf*popsf/totpop)+(sqdums*pops/totpop)+(sqdumuk*popuk/totpop)* This model assumes that missing data does differ because it indicates an intensity of preferences* numsq only counts true sq positions. BDM uses missing positions as indication of intensity* If running listwise deletion (set above), this is model 1 in the IO paper.glm am numsq BDMpred, family(bin) link(probit) robust* These models are the same as the above models, but they control for the number of missing prefs as well.* nummiss simply counts the number of missing prefs and weight miss weights a missing pref by the member * state's proportion of GDP contributed to the EU total. * here I run the model where missing =0, saliency provides no info. * If missing prefs set to position of sq (not listwise), this is model 2 in the IO paper.gen numsq1=numsq+nummissglm am numsq1 BDMpred1, family(bin) link(probit) robust* Missing = SQ but saliency accounted forglm am numsq1 BDMpred, family(bin) link(probit) robust* This is model 3 in the IO paper if not using listwise deletionglm am numsq nummiss BDMpred, family(bin) link(probit) robust* This is model 4 in the IO Paper if not using listwise deletionglm am numsq nummiss gdpweightmiss BDMpred, family(bin) link(probit) robust* Other models not reported in the paper (but found in the dissertation controlling for other operationalizations of Intergov.glm am numsq nummiss gdpweightmiss gdpweightsq, family(bin) link(probit) glm am numsq nummiss cweightmiss cweightsq, family(bin) link(probit) glm am numsq nummiss popmiss popsq, family(bin) link(probit) * Lastly I check whether the BDM var which accounts for saliency outperfoms the BDM var which does notglm am BDMpred BDMpred1, family(bin) link(probit)* Now I create dummy vars if all three large states * take the same position. One dummy for when large * state wish to change the sq and another when they * prefer the sq.gen bigstatepro=1 if (d==1 & f==1 & uk==1)replace bigstatepro=0 if bigstatepro==.gen bigstatecon=1 if (d==sq & f==sq & uk==sq)replace bigstatecon=0 if bigstatecon==.gen bsproalone=1 if bigstatepro==1 & numsq>=8replace bsproalone=0 if bsproalone==.gen bsconalone=1 if bigstatecon==1 & numsq<=8replace bsconalone=0 if bsconalone==.*gen interaction terms to see if numsq is more important or less*important when interated with big state varsgen intbigstatepro=bigstatepro*numsq1gen intbigstatecon=bigstatecon*numsq1gen intbsproalone=bsproalone*numsq1gen intbsconalone=bsconalone*numsq1* gen big state average variablegen bigstateave=(d+f+i+uk)/4* This is model 5 (table 4) in IO Paperglm am numsq1 bigstateave, family(bin) link(probit)* This is model 6 (table 4) in the IO Paper if not running listwise deletion.glm am numsq1 bigstatepro bigstatecon intbigstatepro intbigstatecon, family(bin) link(probit)******************************************************************gen msissue=1 if epms==1replace msissue=2 if fiscal==1replace msissue=3 if cohesion==1replace msissue=4 if employ==1replace msissue=5 if environ==1replace msissue=6 if asylum==1replace msissue=7 if foreign==1replace msissue=8 if other==1bys msissue: egen percentinc=mean(am)gen numsqper=percentinc*numsqglm am numsq nummiss BDMpred percentinc, family(bin) link(probit) robustgen minpivot=3 if epms==1replace minpivot=2 if fiscal==1replace minpivot=3.8 if cohesion==1replace minpivot=3.16666 if employ==1replace minpivot=4.6 if environ==1replace minpivot=4.3846 if asylum==1replace minpivot=3.6 if foreign==1glm am numsq nummiss BDMpred minpivot, family(bin) link(probit) robust* Run chapter 5 model with missing=indiffglm am b dk d gr e f i irl nl lux a p s sf uk, nocon family(bin) link(probit) robustglm am ep com b dk d gr e f i irl nl lux a p s sf uk, nocon family(bin) link(probit) robustsave "temp/temp_indiff.dta", replace